knitr::opts_knit$set(root.dir = '../../')

1 Overall Activation

source('scripts/my_r.R')
library(feather)
## Warning: package 'feather' was built under R version 3.3.2
library(ggplot2)
library(reshape2)
library(bsselectR)
info <- c('Type1', 'newseq.matchgc.Noonan', 'motif_activation')
pos <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_positive.feather')
neg <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_negative.feather')
ggplot(pos$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Positive)') + labs(x = 'motif', y = 'sequence')

ggplot(neg$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Negative)') + labs(x = 'motif', y = 'sequence')

2 Per Motif Activation

pvalues <- c()
motifs <- c()
for(i in colnames(pos$table)){
    if(i != 'id'){
        poss <- pos$table[[i]]
        negs <- neg$table[[i]]
        pvalues <- c(pvalues, wilcox.test(poss, negs)$p.value)
        motifs <- c(motifs, i)
    }
}
df <- data.frame(motif=motifs, p.value=pvalues)

2.1 Motif activation comparison (positive vs negative)

3 Show top 20 motifs

3.1 1 : Motif.185

1 : Motif.185 ##2 : Motif.291 2 : Motif.291 ##3 : Motif.275 3 : Motif.275 ##4 : Motif.100 4 : Motif.100 ##5 : Motif.59 5 : Motif.59 ##6 : Motif.78 6 : Motif.78 ##7 : Motif.241 7 : Motif.241 ##8 : Motif.29 8 : Motif.29 ##9 : Motif.168 9 : Motif.168 ##10 : Motif.193 10 : Motif.193 ##11 : Motif.73 11 : Motif.73 ##12 : Motif.46 12 : Motif.46 ##13 : Motif.106 13 : Motif.106 ##14 : Motif.0 14 : Motif.0 ##15 : Motif.154 15 : Motif.154 ##16 : Motif.143 16 : Motif.143 ##17 : Motif.222 17 : Motif.222 ##18 : Motif.278 18 : Motif.278 ##19 : Motif.133 19 : Motif.133 ##20 : Motif.14 20 : Motif.14